var hs405 = document.getElementById("h-s405");
var list1 = document.querySelector(".h-cookie-list");

hs405.onkeyup = function(){
	var word = this.value;
	ajax({
		method:"get",
		url:"js/search.php",
		isAsyc:true,
		params:{wd:word},
		success:function(data){
			list1.innerHTML=""; //每次先清空列表 
			if(data==""){
				list1.className="";
			}else{
				var arr = JSON.parse(data);
				for(var i=0;i<arr.length;i++){
					var li = document.createElement("li");
					li.innerHTML=arr[i];
					li.onclick = function(){
						var v = this.innerHTML;
						txt.value = v;
						list1.className="";
					}
					list1.appendChild(li);
				}
				list1.className="active";
			}
		},
		error:function(mes){
			alert(mes);
		}
	});
}
